package com.zuipin.vo;

import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 
 * @author zhuangjiajian
 * @date 2017-7-19 上午08:47:07
 *
 */
@ApiModel(description = "再次购买的订单vo")
public class FrontOrderVo {
	
	private Long						buyerId;
	private String						device;
	private Long						sysId;
	private Boolean						opera;	// false 不执行加入购物车功能只校验返回code代码
	
	private List<FrontOrderDetailVo>	odetail;
	
	public FrontOrderVo() {
		// TODO Auto-generated constructor stub
	}
	
	@ApiModelProperty(value = "买家ID", required = true)
	public Long getBuyerId() {
		return buyerId;
	}
	
	public void setBuyerId(Long buyerId) {
		this.buyerId = buyerId;
	}
	
	@ApiModelProperty(value = "device", required = true)
	public String getDevice() {
		return device;
	}
	
	public void setDevice(String device) {
		this.device = device;
	}
	
	@ApiModelProperty(value = "系统ID", required = true)
	public Long getSysId() {
		return sysId;
	}
	
	public void setSysId(Long sysId) {
		this.sysId = sysId;
	}
	
	@ApiModelProperty(value = "true: 返回不能购买商品信息并执行加入购物车动作   false:只返回校验结果代码 code", required = true)
	public Boolean getOpera() {
		return opera;
	}
	
	public void setOpera(Boolean opera) {
		this.opera = opera;
	}
	
	@ApiModelProperty(value = "再次购买中订单的商品详细信息", required = true)
	public List<FrontOrderDetailVo> getOdetail() {
		return odetail;
	}
	
	public void setOdetail(List<FrontOrderDetailVo> odetail) {
		this.odetail = odetail;
	}
	
	/**
	 * 通过sku查询出所对应的详细信息
	 * @param proSku
	 * @return
	 */
	public FrontOrderDetailVo getFrontOrderDetailVo(String proSku) {
		List<FrontOrderDetailVo> list = this.getOdetail();
		FrontOrderDetailVo v = null;
		for (FrontOrderDetailVo vo : list) {
			if (vo.getProSku().equals(proSku)) {
				return vo;
			}
		}
		return v;
	}
	
}
